<?php

namespace app\api\controller;


use app\api\service\ActivityService;
use app\common\Common;
use think\facade\Request;

class Activity extends Base
{
    public function info()
    {
        $params = Request::param();
        try {
            validate(\app\api\validate\Activity::class)->scene('activity_info')->check($params);
            $activity = ActivityService::getActivity($params);
            if (!$activity) {
                return Common::fail('无活动', '4004', null);
            }
            return Common::success($activity);
        } catch (\Exception $e) {
            return Common::fail($e->getMessage());
        }
    }
}